#!/bin/sh

if [ "$1" = "autoconf" ]; then
	echo 'yes'
	exit 0
fi

if [ "$1" = "config" ]; then
	cat <<EOF
graph_title VFS IO Operations
graph_category disk
graph_vlabel iops read(-) / write(+) per \${graph_period}
graph_args --base 1000
graph_info per zone vfs io operations
reads.label reads
reads.type DERIVE
reads.min 0
reads.graph no
writes.label iops
writes.type DERIVE
writes.min 0
writes.negative reads
EOF
	exit 0
fi

kstat -p zone_vfs:*:*:reads zone_vfs:*:*:writes | sed 's/.*://g' | awk '{ print $1 ".value", $2 }'
